package com.ruoyi.labortary.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import com.ruoyi.labortary.mapper.AlgsLaboratoryMapper;
import com.ruoyi.labortary.domain.AlgsLaboratory;
import com.ruoyi.labortary.service.IAlgsLaboratoryService;

import javax.annotation.Resource;

/**
 * labortaryService业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-15
 */
@Service
public class AlgsLaboratoryServiceImpl implements IAlgsLaboratoryService 
{
    @Resource
    private AlgsLaboratoryMapper algsLaboratoryMapper;

    @Autowired
    private RedisTemplate redisTemplate;

//    @Autowired
//    private StringRedisTemplate stringRedisTemplate;

    /**
     * 查询labortary
     * 
     * @param laboratoryId labortary主键
     * @return labortary
     */
    @Override
    public AlgsLaboratory selectAlgsLaboratoryByLaboratoryId(Long laboratoryId)
    {
        return algsLaboratoryMapper.selectAlgsLaboratoryByLaboratoryId(laboratoryId);
    }

    /**
     * 查询labortary列表
     * 
     * @param algsLaboratory labortary
     * @return labortary
     */
    @Override
//    @Cacheable(cacheNames = "algsLaboratorys",key="'laboratoryId:'+#algsLaboratory.getLaboratoryId()")
    public List<AlgsLaboratory> selectAlgsLaboratoryList(AlgsLaboratory algsLaboratory)
    {
        System.out.println(algsLaboratoryMapper.selectAlgsLaboratoryList(algsLaboratory));
        return algsLaboratoryMapper.selectAlgsLaboratoryList(algsLaboratory);


    }

    /**
     * 新增labortary
     * 
     * @param algsLaboratory labortary
     * @return 结果
     */
    @Override
    public int insertAlgsLaboratory(AlgsLaboratory algsLaboratory)
    {
        return algsLaboratoryMapper.insertAlgsLaboratory(algsLaboratory);
    }

    /**
     * 修改labortary
     * 
     * @param algsLaboratory labortary
     * @return 结果
     */
    @Override
    public int updateAlgsLaboratory(AlgsLaboratory algsLaboratory)
    {
//        12321321
        return algsLaboratoryMapper.updateAlgsLaboratory(algsLaboratory);
    }

    /**
     * 批量删除labortary
     * 
     * @param laboratoryIds 需要删除的labortary主键
     * @return 结果
     */
    @Override
    public int deleteAlgsLaboratoryByLaboratoryIds(Long[] laboratoryIds)
    {
        return algsLaboratoryMapper.deleteAlgsLaboratoryByLaboratoryIds(laboratoryIds);
    }

    /**
     * 删除labortary信息
     * 
     * @param laboratoryId labortary主键
     * @return 结果
     */
    @Override
    public int deleteAlgsLaboratoryByLaboratoryId(Long laboratoryId)
    {
        return algsLaboratoryMapper.deleteAlgsLaboratoryByLaboratoryId(laboratoryId);
    }
}
